package org.ala.tiktools.generator.mybatis.config;

import org.ala.tiktools.generator.mybatis.config.info.Generator;
import org.ala.tiktools.generator.mybatis.config.info.Part;

import java.util.*;

/**
 * @author ala
 * @date 2024-12-30 13:36
 */
public class ConfigInfo {
    /**
     *  生成者信息
     */
    protected List<Generator> generators;


    public static ConfigInfo build(Map<String, Object> kvs) {
        ConfigInfo info = new ConfigInfo();
        List<Generator> gs = new ArrayList<>();
        kvs.forEach((k,v) -> {
            Map<String, Object> kv = (Map<String, Object>)v;
            gs.add(Generator.build(k, kv));
        });
        info.setGenerators(gs);
        return info;
    }

    public List<Generator> getGenerators() {
        return generators;
    }

    public void setGenerators(List<Generator> generators) {
        this.generators = generators;
    }
}
